#include <stdio.h>
int comp(const void* a, const void* b)
{
	return ( *((int*)a) - *((int*)b));
}
int main()
{
	int n,j=0,i,t,pos,flag;
	scanf("%d", &n);
	int result[n];
	char s[100],o[8];
	while (n>j)
	{
		scanf("%s", &s);
		pos=0;
		for(i=0; pos<7; i++)
		{
			if (s[i] == 'A' || s[i] == 'B' || s[i] == 'C')
			{
				o[pos++] = '2';
			}
			else if (s[i] == 'D' || s[i] == 'E' || s[i] == 'F')
			{
				o[pos++] = '3';
			}
			else if (s[i] == 'G' || s[i] == 'H' || s[i] == 'I')
			{
				o[pos++] = '4';
			}
			else if (s[i] == 'J' || s[i] == 'K' || s[i] == 'L')
			{
				o[pos++] = '5';
			}
			else if (s[i] == 'M' || s[i] == 'N' || s[i] == 'O')
			{
				o[pos++] = '6';
			}
			else if (s[i] == 'P' || s[i] == 'R' || s[i] == 'S')
			{
				o[pos++] = '7';
			}
			else if (s[i] == 'T' || s[i] == 'U' || s[i] == 'V')
			{
				o[pos++] = '8';
			}
			else if (s[i] == 'W' || s[i] == 'X' || s[i] == 'Y')
			{
				o[pos++] = '9';
			}
			else if (s[i]>='0' && s[i] <= '9')
			{
				o[pos++] = s[i];
			}
		}
		o[pos] = '\0';
		sscanf(o, "%d", &t);
		result[j++] = t;
	}
	qsort(result, j, sizeof(int), comp);
	flag=1;

	for (i=0; i<j-1; i++)
	{
		t = 1;
		while (result[i] == result[i+1])
		{
			i++;
			t++;
		}
		if (t > 1)
		{
			printf("%03d-%04d %d\n", result[i]/10000, result[i]%10000, t);
			flag=0;
		}
	}
	if (flag)
	{
		printf("No duplicates. \n");
	}
}

